<!-- rcsid="$Id: index.html,v 1.4 2010/08/09 19:01:24 fetk Exp $" -->
<!-- ===================================================================== -->
<!--#include virtual="../../include/head.html"-->
<!-- ===================================================================== -->

<object class="largeFonts">
GAMer User's Guide
</object>

<br />
<br />

Version 0.1

<br />
<br />

<b>Table of Contents</b>
<ol>
<li> <a href="#overview">Overview</a></li>
<li> <a href="#resources">Information and Resources</a></li>
<li> <a href="#download">Obtaining GAMer</a></li>
<li> <a href="#faq">Frequently Asked Questions</a></li>
<li> <a href="#install">Installation Instructions</a></li>
<li> <a href="#author">Author Information</a></li>
<li> <a href="#license">Copyright and Terms of Use</a></li>
<li> <a href="#gpl">GNU GPL</a></li>
</ol>

<i>
NOTE:
</i>
This documentation provides information about installation, configuration,
and general usage of the GAMer libraries. 
Information about the programming interface provided by the GAMer software
can be found in the <a href="api/html/index.html" target="_blank">Programmer's Guide</a>.

<br />
<br />
<!-- ===================================================================== -->
<hr />
<br />

<b><a name="overview">Overview</a></b>

<br />
<br />
GAMer (Geometry-preserving Adaptive MeshER) is  mesh generation tool that 
produces high-quality simplex meshes of surfaces and volumes (see figures below). It is built 
on top of two state-of-the-art mesh generators: Triangle (for 2D constrained 
Delaunay meshes in the plane) and Tetgen (for 3D constrained Delaunay meshes 
in space), combined with a collection of algorithms for generating, improving, 
refining, and decimating surface triangulations of imbedded interior or exterior 
domain surfaces. GAMer can be used as a small stand-alone adaptive mesh generator. 
<br />
<br />
<a href="images/machE-surf.png" style="text-decoration: none"><img src="images/machE-surf.png" width="250" alt="image" /></a>
<a href="images/machE-tetra.png" style="text-decoration: none"><img src="images/machE-tetra.png" width="250" alt="image" /></a>

<br />
<br />
GAMer can take as 
input a number of formats, including PDB, PQR, OFF, RawIV, and XYZR. The PDB is a 
standard format used in the <a href="http://www.rcsb.org/">Protein 
Data Bank</a> for bio-molecules. A PQR format may be generated from PDB using 
<a href="http://pdb2pqr.sourceforge.net/">PDB2PQR</a>. The OFF is a format used 
in <a href="http://www.geomview.org">Geomview</a> for mesh representation. More details 
on this format may be found at <a href="http://people.scs.fsu.edu/~burkardt/data/off/off.html">here</a>. 
GAMer can also generate meshes from a 3D volume represented RawIV as used internally in
<a href="http://cvcweb.ices.utexas.edu/cvc">CVC</a> at UT-Austin. The XYZR format is a 
simplified version of the PDB/PQR format, which contains only the center (xyz) and 
radius (r) of each atom in a molecule. A brief structure of GAMer is shown in the following figure. 

<br />
<br />
<a href="images/pipeline.jpg" style="text-decoration: none"><img src="images/pipeline.jpg" width="250" alt="image" /></a>
<br />
<br />
GAMer was designed primarily to generate high-quality and adaptive meshes for 
biomedical simulation, although it can also be used for general problems that require 
"good" surface and tetrahedral meshes. The outputs of GAMer can be used directly in 
<a href="http://fetk.org/">FETK</a> or, with slight modifications, in other finite element 
based numerical solvers. Ongoing projects include efficient algorithms for tetrahedral 
mesh smoothing and localized mesh deformation for simulation of molecular/cellular dynamics.

<br />
<br />
<!-- ===================================================================== -->
<hr />
<br />

<b><a name="resources">Information and Resources</a></b>

<br />
<br />
Detailed information about GAMer can be found in the
<a href="index.html">User's Guide</a>
and
<a href="api/html/index.html">Programmers's Guide</a>.

<br />
<br />
While GAMer is itself a self-contained software package, it is one of several
components of 
FETK
(the Finite Element ToolKit).  
FETK
consists of the following components written in Clean OO C:
<ul>
<li> MALOC - Minimal Abstraction Layer for Object-oriented C programs.</li>
<li> PUNC  - Portable Understructure for Numerical Computing.</li>
<li> GAMer - Geometry-preserving Adaptive MeshER (uses MALOC).</li>
<li> SG    - Socket Graphics mesh display tool (uses MALOC).</li>
<li> MC    - Manifold Code finite element package (uses MALOC and PUNC).</li>
<li> MCX   - MC eXtension libraries (uses MALOC, PUNC, and MC). </li>
</ul>

<br />
<br />
MALOC is self-contained, and requires only an ANSI-C compiler on a UNIX
or Win32 platform.  PUNC, GAMer, SG, and MC are also self-contained, but rely
on MALOC having been previously installed on the platform. Additional features
of MC are enabled if PUNC is available, but PUNC is not required to build MC.
The MC eXtension libraries MCX are constructed on top of MALOC and MC, and 
in order install and use MCX one must first correctly configure and install 
both MALOC and MC.  MCX is made up of a number of individual libraries 
developed by members of our group, or contributed by one of a number of 
colleagues.  More information about 
FETK
can be found on the 
FETK
website:
<ul>
<li> <a href="http://www.fetk.org/">http://www.fetk.org/</a></li>
</ul>

<br />
<!-- ===================================================================== -->
<hr />
<br />

<b><a name="download">Obtaining GAMer</a></b>

<br />
<br />
GAMer is copyrighted, but is redistributable in source and binary form
under the following <a href="#license">license</a>.
The GAMer source can be downloaded from the 
<a href="http://www.fetk.org/codes/download/index.html">FETK Download Page</a>.
<br />
<br />

GAMer uses the low-level FETK abstraction library
<a href="../maloc/index.html">MALOC</a>,
which must be installed before installing GAMer.
<br />

<br />
<!-- ===================================================================== -->
<hr />
<br />

<b><a name="faq">Frequently Asked Questions</a></b>

<br />
<br />
<b>
Why did you develop GAMer, given many other mesh generation packages?
</b>

<br />
<br />
The existing mesh generation tools for biomedical applications, especially bio-molecular
surface and volumetric mesh generation, are suffering from either being slow or having 
poorly-shaped angles (too small or too large). GAMer was developed in the hope that it 
could provide a fast tool of finite element mesh generation with the following properties: 
(1) feature-preservation, (2) local adaptivity, (3) high quality (measured by angles), 
and (4) smoothness (for surface meshes).   

<br />
<br />
<b>
What is in all of these subdirectories?  Where exactly is "GAMer"?
</b>

<br />
<br />
GAMer consists of several (class) libraries from which you will call routines
to handle your application.  You will need to write a main driver program
(and any supporting routines you need to define your problem) and then link
to the libraries. As described in the file "INSTALL", you will build all of the 
libraries in one shot for your particular architecture, along with a test program to 
verify that the various pieces are functioning correctly. After the build, you will 
be ready to work with your particular application main driver, and you just need to 
link to the libraries.  Sample main drivers and makefiles are in the "gamer/tools/*" 
subdirectories.  Things are setup for you to work completely in one of those directories. 
Of course, all you really have to do is link to the GAMer libraries, so you can use 
it how you like; the makefiles and drivers in "gamer/tools/*" just provide an example 
of how to get GAMer working correctly.
<br />
<br />
The following directory tree is created when you unpack the GAMer "GAMer.tgz"
distribution file by following the instructions in the INSTALL document:
<br />
<br />
<pre class="smallfonts" style="font-family: Courier New">
                                   GAMer
                                     |
                         ------------------------
                        /    |      |       |    \ 
                     config  doc  examples  src tools
</pre>
<br />
The src directory has the additional subdirectory structure for each
library forming GAMer:
<br />
<br />
<pre class="smallfonts" style="font-family: Courier New">
                                    src  
                                     |
                      ------------------------------
                     /    |      |    |     |       \
                aaa_inc aaa_lib base biom tetgen triangle
</pre>
<br />
Within each library source directory is an additional subdirectory,
"GAMer". The "GAMer" subdirectory contains public headers for the library,
representing the library API; these headers will be installed in the
specified header install directory during the install procedure after
building GAMer.  

<br />
<br />
The following is a brief description of each subdirectory of the package.
<br />
<br />
<pre class="smallfonts" style="font-family: Courier New">
    gamer              - The entire GAMer package
    gamer/config       - GNU Autoconf scripts and non-unix config files
    gamer/doc          - GAMer documentation
    gamer/examples     - Complex examples and data files for using GAMer
    gamer/src          - GAMer source code (all source and headers)
    gamer/src/aaa_inc  - Header installation tools
    gamer/src/aaa_lib  - Library installation tools
    gamer/src/*/gamer  - The GAMer headers (API)
    gamer/src/base     - Source for M. Holst's BASE (GAMer foundation)
    gamer/src/biom     - Source code for GAMer mesh generation/processing
    gamer/src/tetgen   - Source code for tetrahedral generation (TetGen)
    gamer/src/triangle - Source code for triangle generation (Triangle)
    gamer/tools        - Some examples for use with gamer
</pre>
<br />
<b>
Okay, I seem to have installed GAMer correctly; how do I actually use it now?
</b>

<br />
<br />
GAMer can be called as a subroutine or used as a stand-alone program. There are examples 
in "/tools/MeshGen.C" for both cases. When GAMer is called as a subroutine, it returns the 
tetrahedral meshes into a data structure called GemMesh defined as follows (similar to the 
mcsf format used in FETK):
<br />
<br />
<pre class="smallfonts" style="font-family: Courier New">
    typedef struct {
      int dim;
      int dimii;
      int vertices;
      int simplices;
      FETK_VX *vv;
      FETK_SS *ss;
    } GemMesh;
</pre>
<br />
where FETK_VX and FETK_SS are defined as:
<br />
<br />
<pre class="smallfonts" style="font-family: Courier New">
    typedef struct {
      int id;
      int chrt;
      float x;
      float y;
      float z;
    } FETK_VX;
</pre>
<br />
<pre class="smallfonts" style="font-family: Courier New">
    typedef struct {
      int id;
      int grp;
      int mat;
      int fa;
      int fb;
      int fc;
      int fd;
      int na;
      int nb;
      int nc;
      int nd;
    } FETK_SS;
</pre>
<br />
When GAMer is used as a stand-alone program, it writes the results into a file named "abc.pdb.output.out.m", 
assuming that the input be named "abc.pdb". This format can be used directly in FETK. The output tetrahedra 
may be given in three forms in case of the molecular mesh generation, where a large bounding sphere is used 
around the molecule:
<br />
<br />
    (1) The tetrahedral mesh is generated both inside and outside the molecule: 
<br />
<pre class="smallfonts" style="font-family: Courier New">
        Usage: GAMer abd.pdb 1
</pre>
<br />
    (2) The tetrahedral mesh is generated only inside the molecule:
<br />
<pre class="smallfonts" style="font-family: Courier New">
        Usage: GAMer abd.pdb 2
</pre>
<br />
    (3) The tetrahedral mesh is generated only outside the molecule: 
<br />
<pre class="smallfonts" style="font-family: Courier New">
        Usage: GAMer abd.pdb 3
</pre>

<br />
<br />
<b>
How do I specify the active sites of a molecule?
</b>

<br />
<br />
one or more active sites may be specified for a molecule, such that the mesh generated
may be made denser near the active site than the mesh elsewhere and indexed differently.
To generate the mesh with active sites, one can use the following sample command:
<br />
<br />
<pre class="smallfonts" style="font-family: Courier New">
        Usage: GAMer abd.pdb 1(2 or 3) active_site.dat,
</pre>
<br />
where the active_site.dat is defined by a list of spheres as follows:
<br />
<br />
<pre class="smallfonts" style="font-family: Courier New">
    # First Line:
    #     # of active sites, and # of spheres in each active site
    #
    # The remaining lines are grouped by active sites.
    # For each line of an active site:
    #     (x,y,z): coordinates of sphere centers
    #     (r): radius of the sphere
    #     (index): the index used to represent the active site
    #
    # Note that 2,4,5 have been reserved for other purposes
    # So, don't use these numbers for index
    #
    n m
    x11 y11 z11 r11 1
    x12 y12 z12 r12 1
    ...
    x1m y1m z1m r1m 1
    x21 y21 z21 r21 2
    x22 y22 z22 r22 2
    ...
    x2m y2m z2m r2m 2
    ....
    ....
</pre>

<br />
<br />
<b>
How do I modify the "hidden" parameters in GAMer?
</b>

<br />
<br />
All the "hidden" parameters may be modified in the header "gamer/src/biom/gamer/biom.h".
We plan to expose some of these parameters in a later version using a graphical user interface.

<br />
<br />
<!-- ===================================================================== -->
<hr />
<br />

<b><a name="install">Installation Instructions</a></b>

<br />
<br />
<b>
Available distribution formats
</b>

<br />
<br />
GAMer is distributed in both binary format (as a binary RPM file
GAMer-VERSION.i386.rpm for i386-based versions of Linux) and in source
format (as a source RPM file GAMer-VERSION.src.rpm and as a gzipped tar
file "GAMer-VERSION.tar.gz").

<br />
<br />
<b>
Installation using the binary RPM file
</b>

<br />
<br />
The following rpm command will install all of the GAMer headers and libraries
into /usr/local/include and /usr/local/lib, and will install the GAMer
documentation into /usr/share/doc/packages/GAMer:
<br />
<br />
<pre class="smallfonts" style="font-family: Courier New">
    rpm -Uvh GAMer-VERSION.i386.rpm
</pre>

<br />
<br />
<b>
Installation and rebuilding from sources using the source RPM file
</b>

<br />
<br />
The following rpm command will unpack the source rpm file
"GAMer-VERSON.src.rpm" into the GAMer gzipped tar file containing
the sources called "GAMer-VERSION.tar.tar.gz" and into a small RPM
spec file called "GAMer-VERSON.spec":
<br />
<br />
<pre class="smallfonts" style="font-family: Courier New">
    rpm -Uvh GAMer-VERSION.src.rpm
</pre>
<br />
The sources can then be unpacked and built using the directions for
the gzipped tar file below.
Alternatively, the following rpm command will do these steps for you:
<br />
<br />
<pre class="smallfonts" style="font-family: Courier New">
    rpm -bp GAMer-VERSION.spec
</pre>

<br />
<br />
<b>
Rebuilding binary and source RPM files from the gzipped tar file
</b>

<br />
<br />
The GAMer sources contain the RPM spec file "GAMer-VERSON.spec" in the
root source directory; as a result, rebuilding the RPM files from sources
can be done using the rpm command:
<br />
<br />
<pre class="smallfonts" style="font-family: Courier New">
    rpm -ta GAMer-VERSION.tar.gz
</pre>
<br />
The result will be the corresponding source and binary rpm files,
named "GAMer-VERSON.src.rpm" and "GAMer-VERSION.i386.rpm".
Normally, these files are written to /usr/src/redhat/SRPMS
and /usr/src/redhat/RPMS respectively, but you must be logged in
as root for these to work.
The destination directories can be overriden using arguments to the
rpm program (see the rpm manpage).

<br />
<br />
<b>
Installation and building from sources using the gzipped tar file
</b>

<br />
<br />
The following command will
unpack GAMer into a number of subdirectories and files on any UNIX machine
(and on any WinNT machine with the GNU-Win32 tools gzip and tar).
<br />
<br />
<pre class="smallfonts" style="font-family: Courier New">
    gzip -dc GAMer.tgz | tar xvf -
</pre>
<br />
GAMer is essentially a multilevel adaptive finite element "kernel".  It is
designed to be easily extended through the use of extension packages which
are constructed on top of GAMer.  The extension packages that I have written
such such as GAMergp (GAMer for Geometric PDEs) are also distributed as gzipped tar
files (e.g. "GAMergp.tgz").  The installation instructions for such extension
packages are identical to the instructions below for the GAMer kernel (e.g.,
substitute "GAMergp" for every occurance of "GAMer" below).

<br />
<br />
<b>
Building the package using the GNU "configure" shell script and "make"
</b>

<br />
<br />
The "configure" shell script in the "GAMer" directory (the toplevel
directory created when you unpacked the GAMer tgz file) will build the entire
package.  This is a standard GNU autoconf-generated configuration script.
For a list of the possible configuration options, type:
<br />
<br />
<pre class="smallfonts" style="font-family: Courier New">
    ./configure --help
</pre>
<br />
You should be able to build GAMer by simply typing:
<br />
<br />
<pre class="smallfonts" style="font-family: Courier New">
    ./configure
    make
    make install
</pre>
<br />
However, it is often advantageous to keep the original source directory
pristine; the configure script can actually be run outside the source
tree, which will keep all files created by the build outside the source
tree.  (This idea is related to the section below describing how to build
binaries for multiple architectures at the same time using the same source
tree, and requires that your version of make has the VPATH facility, such
as GNU make.)  For example, I build GAMer in a separate directory from the
source tree as follows:
<br />
<br />
<pre class="smallfonts" style="font-family: Courier New">
    gzip -dc GAMer.tgz | tar xvf -
    mkdir GAMer_build
    cd GAMer_build
    ../GAMer/configure
    make
    make install
</pre>

<br />
<br />
<b>
Building binaries for multiple architectures in the same source directory
</b>

<br />
<br />
If you have a version of "make" that supports the VPATH facility (such as
any recent version of GNU make), then you can build the package for multiple
architectures in the same source directory (in fact, you can do the compiles
at the same time without collisions).  This is very useful if you have your
home directory on an NFS volume that you share among multiple architectures,
such as SGI, Linux, etc.  To build GAMer for all the systems at the same time,
you simply make an additional subdirectory in the main GAMer directory for
each architecture, copy "configure" into it, "cd" into the subdirectory, and
then install as above.  For example, on a linux machine you would do the
following:
<br />
<br />
<pre class="smallfonts" style="font-family: Courier New">
    mkdir linux
    cp configure linux/.
    cd linux
    ./configure
    make
    make install
</pre>
<br />
If you mount the same NFS home directory on for example an OpenStep box,
you could at the same time do the following:
<br />
<br />
<pre class="smallfonts" style="font-family: Courier New">
    mkdir next
    cp configure next/.
    cd next
    ./configure
    make
    make install
</pre>
<br />
Again, both builds can actually be done outside the source tree rather
than in a subdirectory of the source tree, as described in the previous
section.

<br />
<br />
<b>
Rebuilding the configure script and the Makefile.in files
</b>

<br />
<br />
If for some reason you actually need to rebuild the configure script or the
Makefile.in files using the GNU autoconf suite, you should read the block of
documentation at the top of the configure.in file.  The commentary I put there
explains exactly how the GNU autoconf suite must be used and in what order,
and exactly what files are produced at each step of the process.  A script
called "bootstrap" which automates this process is located in the config
subdirectory of the GAMer source tree.

<br />
<br />
<b>
Platform-specific information
</b>

<br />
<br />
Below is some platform-specific build/usage information for GAMer.
<ul>
<li>Linux   (Source:  M. Holst, UCSD)
<br />
<br />
    Things should work as described above.
<br />
<br />
</li>
<li>FreeBSD/NetBSD/OpenBSD   (Source:  M. Holst, UCSD)
<br />
<br />
    Things should work as described above.
<br />
<br />
</li>
<li>OpenStep   (Source:  M. Holst, UCSD)
<br />
<br />
    Things should just work, but you may have to set the CC environment
    variable as follows before typing ./configure:
<br />
<pre class="smallfonts" style="font-family: Courier New">
    export CC="/bin/cc"
</pre>
    or you might need to use:
<br />
<pre class="smallfonts" style="font-family: Courier New">
    export CC="/bin/cc -ObjC"
</pre>
<br />
</li>
<li>IRIX   (Source:  M. Holst, UCSD)
<br />
<br />
    If you are on a 64-bit IRIX box such as an Onyx, Octane, or Origin,
    set the CC environment variable as follows before typing ./configure: 
<br />
<pre class="smallfonts" style="font-family: Courier New">
    export CC="/bin/cc -64"
</pre>
    If you are on a 32-bit IRIX box such as an O2 or Indy,
    set the CC environment variable as follows before typing ./configure: 
<br />
<pre class="smallfonts" style="font-family: Courier New">
    export CC="/bin/cc -32"
</pre>
<br />
</li>

<li>Win32   (Source:  M. Holst, UCSD)
<br />
<br />
    Unless you have the Cygwin environment, you need to use one of the
    included project file collections for one of the commercially
    available ANSI C or C++ compilers for the Win32 environment.
</li>
</ul>

<br />
<b>
Debugging using the ElectricFence malloc debug library
</b>

<br />
<br />
To allow ElectricFence to intercept all calls to malloc, free, and
related dynamic memory allocation system calls, simply run the configure
script as follows:

<br />
<pre class="smallfonts" style="font-family: Courier New">
    ./configure --enable-efence
    make clean; make; make install
</pre>

<br />
<br />
<!-- ===================================================================== -->
<hr />
<br />

<b><a name="author">Author Information</a></b>

<br />
<br />
GAMer was developed primarily by Zeyun Yu in the Holst Research Group at UC San Diego.
Below is a credits list for the people that have
contributed to GAMer in one way or another.
The fields below follow the credits file format used in the
Linux kernel CREDITS file to allow for easy manipulation via shell scripts.
The fields are as follows:
<br />
<br />
<pre class="smallfonts" style="font-family: Courier New">
          N: name of contributor
          E: email address
          W: web address
          P: PGP key ID and fingerprint
          D: description of primary contributions
          S: snail-mail address
</pre>
<br />
<pre class="smallfonts" style="font-family: Courier New">
N: Zeyun Yu
E: zeyu@math.ucsd.edu
D: GAMer/doc/*             -- Package documentation (with M. Holst)
D: GAMer/examples/*        -- Package examples (in progress)
D: GAMer/src/biom/*        -- Main source code of GAMer
D: GAMer/tools/*           -- Tools built on the libraries
S: Department of Mathematics
S: UC San Diego
S: La Jolla, CA 92093 USA

N: Michael Holst
E: mholst@ccom.ucsd.edu
W: http://ccom.ucsd.edu/~mholst
P: 1024/0xB5212DCD
D: Makefile*               -- Makefiles for GAMer
D: GAMer/acconfig.h        -- Platform abstraction information
D: GAMer/configure.in      -- GNU autoconf/automake structure
D: GAMer/config/*          -- GNU autoconf/automake shell scripts
D: GAMer/doc/*             -- Package documentation (with Z. Yu)
D: GAMer/src/aaa_inc/*     -- Library header build structure
D: GAMer/src/aaa_lib/*     -- Static/shared library build structure
D: GAMer/src/base/*        -- Foundation headers
S: Department of Mathematics
S: UC San Diego, AP&amp;M 5739
S: La Jolla, CA 92093 USA
</pre>

<br />
<br />
<b>
Software included in the GAMer source code package
</b>

<br />
<br />
A complete roadmap to the source code forming the GAMer package can be
found above. While the core GAMer functions were developed by 
<a href="http://ccom.ucsd.edu/~zeyun/">Zeyun Yu</a>,
the following libraries are currently also included with GAMer:
<br />
<br />
<pre class="smallfonts" style="font-family: Courier New">
    GAMer/src/tetgen/     -- Quality Tetrahedral Mesh Generator and 
                             3D Delaunay Triangulator 
                             (provided by Hang Si)
    GAMer/src/triangle/   -- Two-Dimensional Quality Mesh Generator
                             and Delaunay Triangulator 
                             (provided by Jonathan Richard Shewchuk)
</pre>

<br />
<br />
<b>
Contacting the Author
</b>

<br />
<br />
If you have questions or comments about GAMer, please feel free to contact
us at <a href="mailto:zeyu@math.ucsd.edu">zeyu@math.ucsd.edu</a> or <a href="mailto:mholst@math.ucsd.edu">mholst@math.ucsd.edu</a>.

<br />
<br />
<!-- ===================================================================== -->
<hr />
<br />

<b><a name="license">Copyright and Terms of Use</a></b>
<br />
<br />
Please acknowledge your use of <i>GAMer</i> by citing:
<ul>
<li> Z. Yu, M. Holst, Y. Cheng, and J.A. McCammon, Feature-Preserving Adaptive Mesh Generation for Molecular Shape Modeling and Simulation.
     <i>Journal of Molecular Graphics and Modeling</i>,
     <b>26(8)</b> (2008), pp. 1370-1380.
</li>
</ul>

<br />
This version of GAMer is distributed under the following guidelines:

<ul>
<li>
   GAMer (Geometry-preserving Adaptive MeshER)
<br />
   Copyright (C) 2007-- Zeyun Yu and Michael Holst
   
<br />
<br />
   This program is free software; you can redistribute it and/or modify it
   under the terms of the GNU General Public License as published by the
   Free Software Foundation; either version 2 of the License, or (at your
   option) any later version.
   
<br />
<br />
   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
   See the GNU General Public License for more details.
   
<br />
<br />
   You should have received a copy of the GNU General Public License along
   with this program; if not, write to the Free Software Foundation, Inc.,
   675 Mass Ave, Cambridge, MA 02139, USA.
</li>
</ul>

<br />
<!-- ===================================================================== -->
<hr />
<br />

<b><a name="gpl">GNU GPL</a></b>

<br />
<br />
The GPL (GNU General Public License) below is copyrighted by the
Free Software Foundation.  However, the instance of software that
it refers to, my package in this case, is copyrighted by myself as
the author of the package.  Any additional software that I distribute
with my software is copyrighted by the authors of those pieces of
software (see the individual source files for author information).
---Zeyun Yu and Michael Holst

<br />
<br />
<!-- ===================================================================== -->

<pre class="smallFonts" style="font-family: Courier New">
		    GNU GENERAL PUBLIC LICENSE
		       Version 2, June 1991

 Copyright (C) 1989, 1991 Free Software Foundation, Inc.
 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 Everyone is permitted to copy and distribute verbatim copies
 of this license document, but changing it is not allowed.

			    Preamble

  The licenses for most software are designed to take away your
freedom to share and change it.  By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users.  This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it.  (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.)  You can apply it to
your programs, too.

  When we speak of free software, we are referring to freedom, not
price.  Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.

  To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.

  For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have.  You must make sure that they, too, receive or can get the
source code.  And you must show them these terms so they know their
rights.

  We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.

  Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software.  If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.

  Finally, any free program is threatened constantly by software
patents.  We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary.  To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.

  The precise terms and conditions for copying, distribution and
modification follow.

		    GNU GENERAL PUBLIC LICENSE
   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION

  0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License.  The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language.  (Hereinafter, translation is included without limitation in
the term "modification".)  Each licensee is addressed as "you".

Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope.  The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.

  1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.

You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.

  2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:

    a) You must cause the modified files to carry prominent notices
    stating that you changed the files and the date of any change.

    b) You must cause any work that you distribute or publish, that in
    whole or in part contains or is derived from the Program or any
    part thereof, to be licensed as a whole at no charge to all third
    parties under the terms of this License.

    c) If the modified program normally reads commands interactively
    when run, you must cause it, when started running for such
    interactive use in the most ordinary way, to print or display an
    announcement including an appropriate copyright notice and a
    notice that there is no warranty (or else, saying that you provide
    a warranty) and that users may redistribute the program under
    these conditions, and telling the user how to view a copy of this
    License.  (Exception: if the Program itself is interactive but
    does not normally print such an announcement, your work based on
    the Program is not required to print an announcement.)

These requirements apply to the modified work as a whole.  If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works.  But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.

Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.

In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.

  3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:

    a) Accompany it with the complete corresponding machine-readable
    source code, which must be distributed under the terms of Sections
    1 and 2 above on a medium customarily used for software interchange; or,

    b) Accompany it with a written offer, valid for at least three
    years, to give any third party, for a charge no more than your
    cost of physically performing source distribution, a complete
    machine-readable copy of the corresponding source code, to be
    distributed under the terms of Sections 1 and 2 above on a medium
    customarily used for software interchange; or,

    c) Accompany it with the information you received as to the offer
    to distribute corresponding source code.  (This alternative is
    allowed only for noncommercial distribution and only if you
    received the program in object code or executable form with such
    an offer, in accord with Subsection b above.)

The source code for a work means the preferred form of the work for
making modifications to it.  For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable.  However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.

If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.

  4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License.  Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.

  5. You are not required to accept this License, since you have not
signed it.  However, nothing else grants you permission to modify or
distribute the Program or its derivative works.  These actions are
prohibited by law if you do not accept this License.  Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.

  6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions.  You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.

  7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License.  If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all.  For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.

If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.

It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices.  Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.

This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.

  8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded.  In such case, this License incorporates
the limitation as if written in the body of this License.

  9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time.  Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.

Each version is given a distinguishing version number.  If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation.  If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.

  10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission.  For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this.  Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.

			    NO WARRANTY

  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.

  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.

		     END OF TERMS AND CONDITIONS

	    How to Apply These Terms to Your New Programs

  If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.

  To do so, attach the following notices to the program.  It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.

    (one line to give the program's name and a brief idea of what it does.)
    Copyright (C) 19yy  &lt; name of author >

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA


Also add information on how to contact you by electronic and paper mail.

If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:

    Gnomovision version 69, Copyright (C) 19yy name of author
    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
    This is free software, and you are welcome to redistribute it
    under certain conditions; type `show c' for details.

The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License.  Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.

You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary.  Here is a sample; alter the names:

  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
  `Gnomovision' (which makes passes at compilers) written by James Hacker.

  &lt; signature of Ty Coon >, 1 April 1989
  Ty Coon, President of Vice

This General Public License does not permit incorporating your program into
proprietary programs.  If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library.  If this is what you want to do, use the GNU Library General
Public License instead of this License.
</pre>

<!-- ===================================================================== -->
<!--#include virtual="../../include/tail.html"-->
<!-- ===================================================================== -->
